package com.sphd.beautysalon.presenter;


import com.android.volley.VolleyError;
import com.sphd.beautysalon.info.LoginInfo;
import com.sphd.beautysalon.model.LoginModelImpl;
import com.sphd.beautysalon.view.LoginView;

/**
* Created by Hu on 2016/10/27
*/

public class LoginPresenterImpl implements LoginPresenter {
    LoginView loginView;
    LoginModelImpl loginModel;
    public LoginPresenterImpl(LoginView loginView) {
        this.loginView = loginView;
        loginModel=new LoginModelImpl();
    }

    @Override
    public void addData(String url) {
        loginView.showLoading();
        loginModel.sendUrl(url,this);

    }

    @Override
    public void sendRes(LoginInfo loginInfo) {
        loginView.sendRes(loginInfo);
    }

    @Override
    public void sendCgNo(int cgnumber) {
        loginView.sendCgNo(cgnumber);
    }

    @Override
    public void sendLcgid(int underlingcgid) {
        loginView.sendLcgid(underlingcgid);
    }

    @Override
    public void sendPwdError() {
        loginView.dissLoading();
        loginView.sendPwdError();
    }

    @Override
    public void sendError(VolleyError error) {
            loginView.dissLoading();
            loginView.sendServiceError();
    }
}